# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-invoke
pkgver=2.1.1
pkgrel=2
pkgdesc="Pythonic task execution"
url="https://github.com/pyinvoke/invoke"
license=('BSD')
arch=('any')
depends=('python-fluidity' 'python-lexicon' 'python-yaml')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-pytest' 'python-pytest-relaxed' 'python-icecream')
source=("https://pypi.io/packages/source/i/invoke/invoke-$pkgver.tar.gz")
sha512sums=('f7363996407f4cfa12fe6faf8f60cf2694d41daeee83fefd229d14d0f21573a3752a51623268a023b8566758862f2d79a8b8c2d453a7aabaa9eedbee3da8584b')

prepare() {
  rm -r invoke-$pkgver/invoke/vendor
}

build() {
  cd invoke-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd invoke-$pkgver
  PYTHONPATH="$PWD"/build/lib pytest -s tests -k 'not pty'
}

package() {
  cd invoke-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
